﻿module Runner {
    export class Coin extends Phaser.Sprite {
        constructor(game: Phaser.Game, x: number, y: number) {
            super(game, x, y, 'Coin', 0);

            this.anchor.setTo(0.5, 0);

            this.animations.add('Spin', null, 10, true);
            this.animations.play('Spin');    
            this.game.physics.p2.enable(this);
            this.game.physics.p2.enableBody(this, false);
            this.body.physicsBodyType = Phaser.Physics.P2JS;
            
            this.body.data.gravityScale = 0;    
        }
    }
}